<template>
  <nly-content-wrapper>
    <!-- <nly-content-header>
      <nly-container fluid>
        <nly-row class="mb-2">
          <nly-col sm="6">
            <h1>nly-pagination</h1>
          </nly-col>
        </nly-row>
      </nly-container>
    </nly-content-header> -->
    <nly-content>
      <nly-row>
        <nly-col>
          <nly-card header-variant="navy">
            <!-- <nly-card-header>
              分页
            </nly-card-header> -->
            <nly-card-body>
              <!-- <nly-pagination total="10" /> -->
              <!-- <nly-pagination total="100" />
              <nly-pagination total="100" sm />
              <nly-pagination total="100" lg />
              <nly-pagination total="100" align="center" />-->
              <nly-pagination :total="testTotal" align="left" />
              <input type="number" v-model="testTotal" style="float:left" />
              {{ testTotal }}
            </nly-card-body>
          </nly-card>
        </nly-col>
      </nly-row>
    </nly-content></nly-content-wrapper
  >
</template>

<style lang="less" scoped>
.demo .title {
  text-align: center;
  p {
    background-color: antiquewhite;
  }
}

.demo .row {
  min-height: 90px;
  text-align: center;
}
.demo .row > .col:not(.header),
.demo .row > [class^="col-"] {
  border: 1px solid #bababa;
  background-color: rgba(86, 61, 124, 0.15);
  color: #000;
}
</style>

<script>
import { mapState } from "vuex";
// import PageHeader from "@/components/PageHeader";

export default {
  name: "PageView",
  components: null,
  props: {
    avatar: {
      type: String,
      default: null
    },
    title: {
      type: [String, Boolean],
      default: true
    },
    logo: {
      type: String,
      default: null
    },
    directTabs: {
      type: Object,
      default: null
    }
  },
  data() {
    return {
      testTotal: 6,
      pageTitle: null,
      description: null,
      linkList: [],
      extraImage: "",
      search: false,
      tabs: {}
    };
  },
  computed: {
    ...mapState({
      multiTab: state => state.app.multiTab
    })
  },
  mounted() {
    this.tabs = this.directTabs;
    this.getPageMeta();
  },
  updated() {
    this.getPageMeta();
  },
  methods: {
    getPageMeta() {
      // eslint-disable-next-line
      this.pageTitle = (typeof(this.title) === 'string' || !this.title) ? this.title : this.$route.meta.title

      const content = this.$refs.content;
      if (content) {
        if (content.pageMeta) {
          Object.assign(this, content.pageMeta);
        } else {
          this.description = content.description;
          this.linkList = content.linkList;
          this.extraImage = content.extraImage;
          this.search = content.search === true;
          this.tabs = content.tabs;
        }
      }
    }
  }
};
</script>

<style lang="less" scoped>
.content {
  margin: 24px 24px 0;
  .link {
    margin-top: 16px;
    &:not(:empty) {
      margin-bottom: 16px;
    }
    a {
      margin-right: 32px;
      height: 24px;
      line-height: 24px;
      display: inline-block;
      i {
        font-size: 24px;
        margin-right: 8px;
        vertical-align: middle;
      }
      span {
        height: 24px;
        line-height: 24px;
        display: inline-block;
        vertical-align: middle;
      }
    }
  }
}
.page-menu-search {
  text-align: center;
  margin-bottom: 16px;
}
.page-menu-tabs {
  margin-top: 48px;
}

.extra-img {
  margin-top: -60px;
  text-align: center;
  width: 195px;

  img {
    width: 100%;
  }
}

.mobile {
  .extra-img {
    margin-top: 0;
    text-align: center;
    width: 96px;

    img {
      width: 100%;
    }
  }
}
</style>
